#include <iostream>

using namespace std;

class MinHeap{
private:
	int *heap;
	int _size;

public:
	MinHeap(int size) : heap(NULL), _size(size){
		heap = new int[sizeof(int) * _size];
	}

	~MinHeap(){
		
	}

	void insert(int val){
		heap[_size] = val;
		makeHeap();
		_size++;
	}

	void makeHeap(){
		int tmp = heap[0];
		heap[0] = heap[_size];
		heap[_size] = tmp;
	}

	int getMin(){
		if (_size <= 0 ){
			cout <<"Empty" <<endl;
			return -1;
		}
		int v = heap[0];
		_size --;
		makeHeap();
		return v;
	}


};

int minHeapTest(){
	return 0;
}